package com.Maykk.Demo12;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.stream.Stream;

/**
 * @ClassName: Demo03
 * @Description: TODO Stream 流的生成方式
 * @Author: MaykkStar@163.com
 */
public class Demo03 {
    public static void main(String[] args) {
        // Collection
        ArrayList<String> list = new ArrayList<>();
        list.stream();

        HashSet<String> Set = new HashSet<>();
        Set.stream();

        // Map
        HashMap<String, String> map = new HashMap<>();
        Stream keyStream = map.keySet().stream(); // 生成键的 stream 流
        Stream<Map.Entry<String, String>> mapStream = map.entrySet().stream(); // 生成键值对的 stream 流

        // Arrays
        String[] strArr = {};
        Stream<String> strStream = Stream.of(strArr);

        Stream<Integer> intStream = Stream.of(1, 2, 3, 4, 5, 6, 7, 8, 9);
        Stream<String> strStream1 = Stream.of("1", "2", "3", "4", "5", "6", "7");
    }
}
